Skip to content

Commit 5aa8527

Browse files
nexapytechnexapytech
authored andcommitted
Initial commit: Expense Tracker API with Docker
0 parents  commit 5aa8527

33 files changed

Lines changed: 1173 additions & 0 deletions

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
venv/
2+
__pycache__/
3+
*.pyc
4+
.git
5+
.gitignore
6+
node_modules/

.env

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SECRET_KEY='your_secreat_key'
2+
3+
4+
5+
6+
7+
8+
9+
DB_NAME='expense_tracker_db'
10+
DB_USER='expense_tracker_2025'
11+
DB_PASSWORD='expense@nexapytech'

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Django CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.11"
18+
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -r requirements.txt
23+
- name: Run migrations
24+
run: |
25+
python manage.py makemigrations
26+
27+
- name: Run migrations
28+
run: |
29+
python manage.py migrate
30+
31+
- name: Run tests
32+
run: |
33+
python manage.py test

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Python
2+
__pycache__/
3+
*.pyc
4+
*.pyo
5+
*.pyd
6+
*.sqlite3
7+
*.log
8+
9+
# Virtual environment
10+
venv/
11+
12+

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Use official lightweight Python image (Linux-based)
2+
FROM python:3.11-slim
3+
4+
# Prevent Python from writing .pyc files and unbuffer stdout/stderr
5+
ENV PYTHONDONTWRITEBYTECODE=1
6+
ENV PYTHONUNBUFFERED=1
7+
8+
# Set working directory inside container
9+
WORKDIR /app
10+
11+
# Install system dependencies required for MySQL & building Python packages
12+
RUN apt-get update && apt-get install -y \
13+
build-essential \
14+
default-libmysqlclient-dev \
15+
curl \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
# Copy requirements first (for Docker caching)
19+
COPY requirements.txt .
20+
21+
# Upgrade pip
22+
RUN pip install --upgrade pip
23+
24+
# Install the rest of the requirements (Django, mysqlclient, spacy, etc.)
25+
RUN pip install -r requirements.txt
26+
27+
28+
# Copy all project files into the container
29+
COPY . .
30+
31+
# Expose Django default port
32+
EXPOSE 8000
33+
34+
# Run migrations and start server
35+
CMD ["sh", "-c", "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"]

LICENSE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Nexapy Technologies
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.

README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Nexpenz API 💰📊
2+
3+
**Nexpenz API** is a simple, fast, and secure backend API for a personal finance
4+
tracking mobile application.
5+
It powers the Nexpenz Android app, enabling users to track income, expenses,
6+
and view financial summaries — without signup or ads.
7+
8+
---
9+
10+
## 🚀 Features
11+
12+
- ✅ Add income & expenses instantly
13+
- 📈 Monthly summaries & category-based analytics
14+
- 🧾 Full transaction history
15+
- 🌍 Multi-currency support
16+
- 🔐 API key authentication (no login/signup)
17+
- 🧡 100% free — no ads, no tracking
18+
- 🐳 Docker-ready
19+
- 🧪 CI-tested on Linux
20+
21+
---
22+
23+
## 🛠️ Tech Stack
24+
25+
- **Python 3.11**
26+
- **Django**
27+
- **Django REST Framework**
28+
- **djangorestframework-api-key**
29+
- **SQLite / PostgreSQL**
30+
- **Docker & Docker Compose**
31+
- **GitHub Actions (CI)**
32+
33+
---
34+
35+
## 🐧 OS Support
36+
37+
| OS | Status |
38+
|--------|--------|
39+
| Linux | ✅ Fully supported & recommended |
40+
| macOS | ✅ Supported |
41+
| Windows| ⚠️ Supported (WSL recommended) |
42+
43+
> **Tested on Linux (Ubuntu). Linux is recommended for production.**
44+
45+
---
46+
47+
### API Authentication
48+
49+
This API uses API Key authentication.
50+
- Create API Key
51+
- Log in to Django Admin
52+
- Navigate to API Keys
53+
- Create a key
54+
-Copy it once (shown only once)
55+
56+
or goto nexpenz.nexapytechnologies.com/api/signup to generate a key
57+
58+
## ⚙️ Local Setup (Linux / Windows)
59+
60+
Follow these steps to run the project locally:
61+
62+
63+
64+
65+
api will be accessible at
66+
http://locahost:8000
67+
68+
69+
## Example code
70+
GET /api/transactions/
71+
X-API-KEY: your_api_key_here
72+
73+
74+
## 1. DOWNLOAD APK FILE
75+
http://locahost:8000/downoad_nexpenz
76+
77+
### 1. Clone the repo
78+
79+
```bash
80+
git clone https://github.com/nexapytech/Expense-Tracker-app
81+
cd Expense-Tracker-app
82+
83+
### Docker Setup (Recommended)
84+
docker build -t nexpenz .
85+
docker run -p 8000:8000 nexpenz
86+
87+
88+

api/__init__.py

Whitespace-only changes.

api/admin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.contrib import admin
2+
from .models import AppSetting, AddTransaction
3+
# Register your models here.
4+
admin.site.register(AppSetting)
5+
admin.site.register(AddTransaction)

api/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class ApiConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'api'

0 commit comments

Comments
 (0)