Coding Stars is a robust full-stack authentication application designed to showcase modern web development practices. It features secure user registration and login, role-based access control, password recovery, and integration with third-party OAuth providers like Google and GitHub. The project is built using the MERN stack (MongoDB, Express.js, React.js, and Node.js) and follows best practices for security and scalability.
- User Authentication:
- Secure user registration and login.
- JWT-based authentication with refresh tokens.
-
Role-Based Access Control:
- Admin and user roles with different access levels.
-
Password Management:
- Password recovery with secure email links.
- Password hashing with bcrypt.
- Frontend:
- Responsive and interactive UI built with React and Tailwind CSS.
- Backend:
- RESTful API with Express.js and secure routes.
- MongoDB as the database.
- Extras:
- Rate limiting and IP blocking for enhanced security.
- Comprehensive error handling and logging.
- Unit and integration tests with Jest and Supertest.
| Category | Technology |
|---|---|
| Frontend | React.js, Tailwind CSS |
| Backend | Node.js, Express.js |
| Database | MongoDB |
| Authentication | JWT, OAuth 2.0 (Google, GitHub) |
| State Management | Redux |
| Testing | Jest, Supertest |
| Deployment | Vercel (Frontend), Render (Backend) |
-
Clone the Repository:
git clone https://github.com/ram8528/codingstars.git cd coding-stars -
Install Dependencies:
-
For Backend:
cd backend npm install -
For Frontend:
cd ../frontend npm install
-
-
Environment Variables:
Create
.envfiles in bothbackendandfrontendfolders and add the following:Backend
.env:PORT=4000 MONGO_URI=your-mongodb-uri JWT_SECRET=your-jwt-secret JWT_REFRESH_SECRET=your-refresh-token-secret GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret GITHUB_CLIENT_ID=your-github-client-id GITHUB_CLIENT_SECRET=your-github-client-secret FRONTEND_URL= https://codingstars.vercel.app/
Frontend
.env:REACT_APP_BACKEND_URL=http://localhost:5000
-
Run the Application:
-
Start Backend:
cd backend npm run dev -
Start Frontend:
cd ../frontend npm start
-
-
Access the Application:
- Frontend:
https://codingstars.vercel.app/ - Backend:
https://coding-stars-nove.vercel.app/
- Frontend:
.
├── backend
│ ├── controllers
│ ├── middlewares
│ ├── models
│ ├── routes
│ ├── utils
│ └── app.js
├── frontend
│ ├── src
│ │ ├── components
│ │ ├── pages
│ │ ├── services
│ │ ├── store
│ │ └── App.js
└── README.md
POST /api/auth/register- Register a new user.POST /api/auth/login- Login a user.POST /api/auth/logout- Logout a user.POST /api/auth/refresh-token- Refresh JWT token.POST /api/auth/password-reset- Request password reset.PUT /api/auth/password-reset/:token- Reset password.
GET /api/users- Get all users (Admin only).GET /api/users/:id- Get user details (Admin & Owner).
-
Frontend:
- Deploy to Vercel.
-
Backend:
- Deploy to Vercel.
-
Environment Variables:
- Add the same
.envvariables to your hosting platforms.
- Add the same
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the MIT License. See the LICENSE file for details.
Developer: Ramdeep Kesharwani
Email: codingstars40@gmail.com
GitHub: ram8528





