CodeTalk is a Q&A web application built using React and NestJS. The platform is designed to enable developers to ask questions, share their knowledge, and assist each other in solving technical challenges. It serves as a hub for collaborative learning and problem-solving, fostering a community where expertise and insights can be exchanged.
- Technology Stack:
- Table of Contents
- Dependencies
- Project setup
- Admin panel
- API Documentation
- License
-
User Registration and Authentication. CodeTalk allows users to register and authenticate securely using email/password.
-
Role-Based Access Control. The platform supports role-based access control (RBAC) to ensure that different users (admin or regular user) have appropriate permissions.
-
OAuth Integration with GitHub/Google. Users can sign up or log in using their GitHub or Google accounts, streamlining the authentication process without needing to remember additional credentials.
-
Markdown Support in Posts. CodeTalk supports Markdown syntax for writing posts, allowing users to format text, add images, and create rich, structured content in a simple and efficient way. The editor supports GitHub-flavored Markdown for easy integration with external resources.
-
Post Categories. Posts are organized into categories, and users can filter content based on the tags associated with each post. This feature makes it easy for users to navigate the platform and find relevant content based on their interests.
-
Comment System. Users can engage in discussions via a comment section under each post. Comments support threading and replies, facilitating deeper conversations.
-
Search Functionality. The platform includes a search feature to quickly find posts, categories, or users based on keywords or tags.
-
Admin Panel. CodeTalk comes with an admin panel for managing users, posts, comments, and other platform resources. Admins can view and manage content with ease, ensuring smooth platform operation.
-
API Documentation with Swagger A fully interactive API documentation is available via Swagger, providing details on available endpoints, request/response formats, and sample queries. This makes it easier for developers to integrate with the CodeTalk API.
- NestJS, Node.js
- PostgreSQL
- Redis
- Prisma
- JWT with Passport.js for secure user authentication
- Swagger for API documentation
- React
- Redux
- MUI
The project relies on the following technologies:
- Node.js v16.x or higher.
- NPM v7.x or higher.
- PostgreSQL v13.x or higher.
- Redis v6.x or higher
If you don't have PostgreSQL and Redis installed on your local machine, you can run the application using Docker. The docker-compose.yaml file provided in the project will set up the necessary containers for you.
Note
Make sure you have Docker and Docker Compose installed on your machine.
Start the containers by running the following command in your project directory:
$ docker-compose up -dThis command will start the PostgreSQL and Redis containers in the background.
Clone the project to your local machine
$ git clone https://github.com/neffarrty/Ucode-Connect-usof.gitGo to the project directory
$ cd Ucode-Connect-usof/Navigate to the backend directory
$ cd backend/Copy the example .env file and fill in any necessary values
$ cp .env.example .envInstall project dependencies
$ npm installInitialize the database and generate the Prisma client
$ npx prisma migrate dev --name init
$ npx prisma generateSeed the database if required
$ npx prisma db seedTo run the application locally, you'll need to start the server using the following command:
$ npm run startOnce the server has started successfully, the API will be accessible at http://localhost:3000/api.
Navigate to the frontend directory
$ cd frontend/Copy the example .env file and fill in any necessary values
$ cp .env.example .envInstall dependencies
$ npm installRun the client locally
$ npm run devOnce the client has started successfully, the apllicatian will be accessible at http://localhost:3001/.
After starting the server, you can access the admin panel at http://localhost:3000/admin. Default admin user is generated during databse seeding and has the following credentials:
| Password | |
|---|---|
| admin@example.com | admin |
Use these credentials to log in to the admin panel.
The complete API reference can be accessed on SwaggerHub.
If the server is running locally, you can also view the documentation at http://localhost:3000/docs. This URL provides access to the API endpoints and methods directly from your server environment, allowing you to test and interact with the API in real-time.
Project is licensed under MIT License.