- Backend Repository: https://github.com/jainamit130/Reddit-Clone-Backend
- Frontend Repository: https://github.com/jainamit130/Reddit-Clone-Client
This project is a clone of Reddit, built to practice and demonstrate skills in full-stack development using Angular for the frontend and Spring Boot for the backend. It includes features such as user authentication, creating posts, and commenting on posts.
- User Authentication (Sign Up, Log In, Log Out)
- Create, Read, Update, Delete (CRUD) Posts
- Upvote and Downvote Posts
- Comment on Posts
- User Profiles
- Frontend: Angular
- Backend: Spring Boot
- Database: MySQL / PostgreSQL
- Authentication: JWT + Refresh Tokens
bash git clone https://github.com/jainamit130/Reddit-Clone-Client.git git clone https://github.com/jainamit130/Reddit-Clone-Backend.git
-
Navigate to the backend directory: cd Reddit-Clone-Backend
-
Install dependencies: mvn install
-
Set up environment variables: Set up application.properties file in src/main/resources directory and update the following to the respective database: spring.datasource.url=jdbc:mysql://localhost:3306/reddit_clone spring.datasource.username=your_mysql_username spring.datasource.password=your_mysql_password spring.jpa.hibernate.ddl-auto=update jwt.secret=your_secret_key
-
Start the backend server: Run the application on the local machine
-
Navigate to the frontend directory: cd Reddit-Clone-Client
-
Install dependencies: npm install
-
Start the frontend server: ng serve
-
Open your browser and navigate: http://localhost:4200/.
- Open your browser and go to http://localhost:4200/
- Sign up for a new account or log in with existing credentials.
- Create new posts, upvote/downvote posts, and comment on posts.
- POST /api/auth/register - Register a new user
- POST /api/auth/login - Log in a user
- GET /reddit/posts - Get all posts
- POST /reddit/posts - Create a new post
- GET /reddit/posts/:id - Get a single post by ID
- PUT /reddit/posts/:id - Update a post by ID
- DELETE /reddit/posts/:id - Delete a post by ID
- POST /reddit/posts/:postId/comments - Add a comment to a post
- GET /reddit/posts/:postId/comments - Get comments for a post