Accounting System built on .net core, opensource and cross platform (ASP.NET Core MVC + ReactJS on the Frontend). This is useful if you have a requirement to develop accounting system. Although it's still in early stage and still have lots of work to do but happy to share it to anyone. It is designed for small size businesses and the idea is to help them run efficient business by using Accounting System fit to them.
% dotnet --list-sdks
7.0.103 [/usr/share/dotnet/sdk]
If you install your .net runtime to other location other than default installation directory, you need to set the environment variable DOTNET_ROOT
to the installation directory of your dotnet. For example, I installed my dotnet sdk to /usr/bin/dotnet
so I will set the env variable to:
% export DOTNET_ROOT=/usr/bin/dotnet
On a high level, this solution will provide modules including but not limited to
https://github.com/AccountGo/accountgo
AccountGoWeb
project requires webpack
, webpack-cli
, gulp
and typescript
installed and if you wish to install these globally you can proceed on these below steps. Otherwise you can skip these steps and proceed to Project Builds
src/accountgoweb
and install all npm packages by calling npm install
NOTE: If you encounter error on npm install in AccountGoWeb project, try to delete the package_lock.json
file and run npm install again.
npm install -g typescript
npm install -g webpack-cli
npm install -g webpack
npm install -g gulp
Normal project build steps that you need to go through:
src/Core
and execute dotnet restore
then dotnet build
Services
, Dto
, Api
and AccountGoWeb
respectively and make sure all projects build successfullydotnet build
. To do this change directory to src
folder, execute dotnet restore
, then dotnet build
Preceding steps confirms all projects can build successfully using dotnet build
. Succeeding steps will provide specific instructions to :
Let's start with database setup first.
You can opt to install your local SQL Server instance or you can use docker image (like we do). Feel free to choose what suits you best:
Assuming you have docker installed (make sure to use linux container), follow the steps below. (Install docker if you haven't done so.)
docker pull microsoft/mssql-server-linux
. We prefer to use SQL Server for Linux for lightweight.docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Str0ngPassword' -p 1433:1433 -d --name=local-mssql microsoft/mssql-server-linux
. The default database user here is sa
Note: If you are encountering issue where the docker container close immediately, try to use docker-compose up
but be sure to comment out web
and api
services so that db
service is the only service that will be configured to run.If you are using Mac M1 or higher, you can use Azure SQL Edge which can support arm64 architecture.
docker run -e "ACCEPT_EULA=1" -e "MSSQL_SA_PASSWORD=Str0ngPassword" -e "MSSQL_PID=Developer" -e "MSSQL_USER=SA" -p 1433:1433 -d --name=sql mcr.microsoft.com/azure-sql-edge
Checking docker connection using SQL Operation Studio:
If you have an existing SQL Server either from your local machine or remotely, you can opt to create your own accountgo database instance:
CREATE DATABASE accountgodb
NOTE: This is optional. EF Migration script will auto create database if not exist.Using EntityFrameworkCore CLI database migration will create and migrate the accountgodb
database to the current version. Make sure you have dotnet ef tool.
% dotnet tool list -g
Package Id Version Commands
--------------------------------------
dotnet-ef 3.1.6 dotnet-ef
% dotnet tool install --global dotnet-ef
If publishing database for the first time or there are changes made to the models, use EntityFrameworkCore CLI database migration to create an update migration to keep the accountgodb
database updated.
In root folder accountgo
run the following command using a terminal, command prompt, or package manager console:
dotnet ef migrations add {Name} --project ./src/Api/ --startup-project ./src/Api/Api.csproj --msbuildprojectextensionspath .build/obj/Api/ --context ApplicationIdentityDbContext --output-dir Data/Migrations/IdentityDb
dotnet ef migrations add {Name} --project ./src/Api/ --startup-project ./src/Api/Api.csproj --msbuildprojectextensionspath .build/obj/Api/ --context ApiDbContext --output-dir Data/Migrations/ApiDb
Note: {Name}
must be provided. For example the name can be "InitialMigration". The above command will create migration scripts. Obviously, if you are doing this for the first time, the migration scripts contains all tables. Make you can connect to your database since the EF will connect to that and check for existing database and tables.
Then to actually publish, In root folder accountgo
run the following command using a terminal, command prompt, or package manager console:
dotnet ef database update --project ./src/Api/ --msbuildprojectextensionspath .build/obj/Api/ --context ApplicationIdentityDbContext
dotnet ef database update --project ./src/Api/ --msbuildprojectextensionspath .build/obj/Api/ --context ApiDbContext
At this point, your database has no data on it. But there is already an initial username and password (admin@accountgo.ph/P@ssword1) and you can logon to the UI. Now lets, create some initial data that would populate the following models.
To initialize a company, call the api endpoint directly http://localhost:8001/api/administration/setup from the browser or by using curl e.g. curl http://localhost:8001/api/administration/setup
. If you encounter some issues, the easy way for now is recreate your database and repeat the Publish Database
section.
src/Api
projectdotnet build
Properties
folder Use the launchsettings.json
to change database connection DBSERVER
, DBUSERID
and DBPASSWORD
. The appsettings.json
contain connectionstring but need to supply some values.dotnet run
.
dotnet run --environment Development
dotnet run --environment Development server.urls=http://+:8001
. It could be any port as you like, but the front-end is hard-coded to call api on port http://localhost:8001. So change the front-end as too. By default, port is open to 5000 and 5001 (http and https respectively).AccountGoWeb
require more steps to completely build the front-end artifacts. To do this, follow the succeeding steps:
src/AccountGoWeb
and open a new Visual Studio Code terminalgulp
(This will run the gulpfile.js). Else run npm run gulp
tsc
(This will run the tsconfig.json). Else run npm run tsc
webpack
(This will run the webpack.config.js). Else, run npm run webpack
src/AccountGoWeb
terminal, execute dotnet build
Note:
If you encounter this error below, then run dotnet restore
on SampleModule
project.
/usr/local/share/dotnet/sdk/2.1.401/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(198,5): error
NETSDK1004: Assets file '/Users/Marvs/source/accountgo/.build/obj/SampleModule/project.assets.json' not found. Run a NuGet package restore to generate this file.
[/Users/Marvs/source/accountgo/src/Modules/SampleModule/SampleModule.csproj]
6 Warning(s)
1 Error(s)
dotnet run
. If launchsettings.json
ommitted, thus, the following points are important.
dotnet run --environment Development
dotnet run --environment Development server.urls=http://+:8000
. It could be any port as you like. By default, port is open to 5000 and 5001 (http and https respectively).dotnet run
will use launchsettings.json
by default if exist.UPDATE: Above steps are still valid, however, dotnet run --environment Development server.urls=http://+:8000
will automatically execute gulp, tsc, and webpack commands. Changes to the styles must be done inside the Scss folder as any modifications in the css files inside wwwroot/css
folder will only be overriden if a sass compilation is done using npm run css
. Everytime, you change the source scss files, run npm run css
first before dotnet build
to ensure that the latest style modifications are being used
Your wwwroot folder should be look like this if you correctly followed the steps above.
To run everything (database, api, web) in docker container you can use docker-compose.yml
accountgo
docker-compose up
or docker-compose up --build
Publish Database (Create Tables, Foreign Keys, and some Initial Data)
above.curl http://localhost:8001/api/administration/initializedcompany
Demo site (new UI) : http://accountgo.net
Dark theme
If you are a developer and wanted to take part as contributor/collaborator we are happy to welcome you! To start with, you can visit the issues page and pick an issue that you would like to work on.
So go ahead, add your code and make your first pull request.
Feel free to email mvpsolution@gmail.com of any questions.