Finfom is a robust document management and secure sharing platform built using Node.js, Express, and TypeScript. It leverages a modern microservice-ready architecture to handle file versioning, granular access control, and real-time analytics for digital assets.
- Node.js & TypeScript: High-performance server-side logic with static typing for maintainability.
- MongoDB & Mongoose: Flexible NoSQL data modeling for documents, and folders
- Redis: In-memory data store used for API response caching to optimize public resource access.
- Cloudinary: Integrated cloud storage for secure asset hosting and optimized file delivery.
- Multer: Efficient handling of multipart/form-data for seamless document uploads.
- JWT: Stateless authentication mechanism using JSON Web Tokens for secure session management.
- Winston & Morgan: Comprehensive logging suite for auditing HTTP traffic and system events.
- Clone the repository:
git clone https://github.com/Webziro/Fom-app.git- Navigate to the backend directory:
cd finfom-backend- Install production and development dependencies:
npm install- Seed the system groups (Technology, Business, etc.):
npm run seed- Launch the development server:
npm run devCreate a .env file in the backend root and configure the following:
PORT=5000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/finfom
REDIS_HOST=localhost
REDIS_PORT=6379
JWT_SECRET=your_jwt_secret_key
JWT_EXPIRE=7d
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
CLIENT_URL=http://localhost:5173
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_EMAIL=your_email@gmail.com
SMTP_PASSWORD=your_app_password
FROM_NAME=Finfom
FROM_EMAIL=no-reply@finfom.com
http://localhost:5000
Request:
{
"username": "johndoe",
"email": "john.doe@example.com",
"password": "StrongPassword123!"
}Response:
{
"success": true,
"data": {
"id": "64f8a7b2c9d4e5f6a7b8c9d0",
"username": "johndoe",
"email": "john.doe@example.com",
"role": "user",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}Errors:
- 400: User already exists or validation failed (password too weak, invalid email).
Request:
{
"email": "john.doe@example.com",
"password": "StrongPassword123!"
}Response:
{
"success": true,
"data": {
"id": "64f8a7b2c9d4e5f6a7b8c9d0",
"token": "eyJhbGciOiJIUzI1Ni..."
}
}Errors:
- 401: Invalid credentials.
Request: Multipart Form Data
file: binary data (PDF, JPG, PNG, DOCX)title: "Quarterly Report"description: "Final version for Q3"visibility: "private" | "public" | "password"password: "secret123" (if visibility is password)
Response:
{
"success": true,
"data": {
"id": "64f8a7b2c9d4e5f6a7b8c9d1",
"title": "Quarterly Report",
"url": "https://res.cloudinary.com/...",
"currentVersion": 1
}
}Errors:
- 400: Missing required fields or invalid file type.
Request:
GET /api/files?page=1&limit=10&search=report&folderId=64f...
Header: Authorization: Bearer
Response:
{
"success": true,
"data": [...],
"pagination": {
"total": 25,
"pages": 3
}
}Request:
{
"password": "secret123"
}Response: Binary stream with Content-Disposition header
Errors:
- 403: Access denied (private file or incorrect password).
Request: Header: Authorization: Bearer
Response:
{
"success": true,
"data": {
"totalDownloads": 150,
"storageUsed": 10485760,
"topFiles": [...],
"fileTypes": [{"_id": "application/pdf", "count": 10}]
}
}Request:
{
"title": "Tax Returns 2024",
"description": "Financial folders"
}Response:
{
"success": true,
"data": {
"id": "64f8a7...",
"title": "Tax Returns 2024"
}
}| Technology | Description | Link |
|---|---|---|
| Node.js | JavaScript Runtime | Link |
| TypeScript | Typed JavaScript | Link |
| Express | Web Framework | Link |
| MongoDB | NoSQL Database | Link |
| Redis | Caching Engine | Link |
| Cloudinary | Cloud Storage | Link |
| Vite | Frontend Tooling | Link |
| Tailwind CSS | Utility-first CSS | Link |
- Fork the repository.
- Create a new feature branch (
git checkout -b feature/NewFeature). - Commit your changes with descriptive messages.
- Push to the branch (
git push origin feature/NewFeature). - Open a Pull Request for review.
Project Lead
- GitHub: Webziro
- Twitter: [Placeholder]
- LinkedIn: [Placeholder]