https://github.com/asmitranjansinha/localloud-api
LocalLoud API is a NestJS-powered backend providing community-driven discussions, voting systems, and authentication for the LocalLoud mobile app.
https://github.com/asmitranjansinha/localloud-api
api community discussions jwt-authentication localloud mysql nest-js restful-api typescript voting-system
Last synced: 6 months ago
JSON representation
LocalLoud API is a NestJS-powered backend providing community-driven discussions, voting systems, and authentication for the LocalLoud mobile app.
- Host: GitHub
- URL: https://github.com/asmitranjansinha/localloud-api
- Owner: asmitranjansinha
- Created: 2024-05-05T13:53:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-06T08:54:52.000Z (8 months ago)
- Last Synced: 2025-02-06T09:37:58.211Z (8 months ago)
- Topics: api, community, discussions, jwt-authentication, localloud, mysql, nest-js, restful-api, typescript, voting-system
- Language: TypeScript
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ LocalLoud API
LocalLoud API is the backend service for the **LocalLoud** mobile application, built with **NestJS**. It provides the necessary APIs for community-driven discussions, voting systems, and user authentication. This project is designed to work seamlessly with the [LocalLoud Flutter frontend](https://github.com/asmitranjansinha/localloud).
---
## โจ Features
- **๐ฃ Community-Based Discussions** - APIs to create, read, update, and delete community posts.
- **๐ณ Voting System** - APIs to create and participate in polls.
- **๐ User Authentication** - Secure user authentication and authorization using JWT.
- **๐ก RESTful APIs** - Clean and well-structured RESTful endpoints.
- **๐งฉ Modular Architecture** - Organized codebase with a modular structure for scalability.---
## ๐ Tech Stack
- **๐ Framework**: NestJS
- **๐ฆ Package Manager**: Yarn
- **๐พ Database**: MySQL & SQLite3
- **๐ Authentication**: JWT (JSON Web Tokens)
- **โ ORM**: TypeORM---
## ๐ Project Structure
```
๐ฆ localloud-api
โฃ ๐ src
โ โฃ ๐ modules
โ โ โ ๐ example
โ โ โ โฃ ๐ example.controller.ts
โ โ โ โฃ ๐ example.service.ts
โ โ โ โ ๐ example.module.ts
โ โฃ ๐ app.controller.ts
โ โฃ ๐ app.module.ts
โ โ ๐ main.ts
โฃ ๐ test
โ โ ๐ (test files)
โฃ ๐ .env
โฃ ๐ .gitignore
โฃ ๐ package.json
โฃ ๐ yarn.lock
โ ๐ README.md
```---
## ๐ฆ Dependencies
This project uses the following key dependencies:
### ๐ง Core Dependencies
- `@nestjs/core` - Core framework for building scalable server-side applications.
- `@nestjs/common` - Common utilities and decorators for NestJS.
- `@nestjs/platform-express` - Express platform for NestJS.
- `typeorm` - ORM for database interactions.
- `mysql2` & `sqlite3` - MySQL & SQLite3 database support.
- `bcrypt` - Secure password hashing.
- `jsonwebtoken` - JSON Web Token (JWT) for authentication.### ๐ Development Dependencies
- `@nestjs/cli` - NestJS command-line interface.
- `@nestjs/schematics` - Schematics for scaffolding NestJS projects.
- `typescript` - TypeScript support.
- `jest` - Testing framework.
- `eslint` & `prettier` - Linting and code formatting.To install dependencies, run:
```bash
yarn install
```---
## ๐ Installation
1. **Clone the repository:**
```bash
git clone https://github.com/yourusername/localloud-api.git
cd localloud-api
```2. **Install dependencies:**
```bash
yarn install
```3. **Set up environment variables:**
Create a `.env` file in the root directory and add the necessary environment variables (e.g., database connection string, JWT secret).
Example `.env` file:
```env
DATABASE_URL=your_database_url
JWT_SECRET=your_jwt_secret
```4. **Run the application:**
```bash
yarn start
```5. **Access the API:**
The API will be available at `http://localhost:3000/api`.
---
## ๐ Available Scripts
These scripts help in development, testing, and production:
| Command | Description |
|--------------------------|---------------------------------------------|
| `yarn start` | ๐ Starts the application |
| `yarn start:dev` | ๐ Starts the app in watch mode for development |
| `yarn start:debug` | ๐ Starts the app in debug mode |
| `yarn start:prod` | โก Runs the compiled app in production mode |
| `yarn build` | ๐ Builds the project |
| `yarn lint` | ๐งน Lints the code with ESLint |
| `yarn format` | ๐จ Formats the code using Prettier |
| `yarn test` | ๐งช Runs all tests using Jest |
| `yarn test:watch` | ๐ Runs Jest in watch mode |
| `yarn test:cov` | ๐ Generates a test coverage report |
| `yarn test:debug` | ๐ Runs Jest with debugging enabled |
| `yarn test:e2e` | ๐ Runs end-to-end tests |---
## ๐ค Contributing
Contributions are welcome! Follow these steps to contribute:
1. **Fork the repository.**
2. **Create a new branch:**```bash
git checkout -b feature/YourFeatureName
```3. **Commit your changes:**
```bash
git commit -m 'โจ Add feature XYZ'
```4. **Push to the branch:**
```bash
git push origin feature/YourFeatureName
```5. **Open a pull request.**
---
## ๐ License
This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.
---