GithubHelp home page GithubHelp logo

bsogulcan / soft-craft-api Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 2.0 434 KB

SoftCraft is fastest way to create new web application based on Abp Boilerplate framework

License: MIT License

C# 99.98% JavaScript 0.01% CSS 0.01%
angular aspnetboilerplate code-generators csharp net-core typescript web-application-generator full-stack-code-generator

soft-craft-api's Introduction

About soft-craft-api!

SoftCraft is fastest way to create new web application based on Abp Boilerplate framework, we call it Generator! This is the backend service of the soft-craft application.

What are the benefits?

SoftCraft creates a backend using (.Net Core 6) and frontend (Angular) application based on the 'Project', 'Entity', 'Enums' and 'Navigation Items' data defined by the user from the web interface.

What Does It Create?

DotNetCodeGenerator creates Entities, Entity Configurations, Repositories, Enums, Dtos, AppServices and Permissions. TypeScriptCodeGenerator creates Dtos, Services, Routes, Enums, List-Create-Edit Components and Navigation Items. ProjectManager creates AbpBoilerplate application according to the generated codes.

Dependent Projects

Client project of SoftCraft: soft-craft-client
Base project to generate projects: soft-craft-base-apb-boilerplate-project

Architecture

Architecture

Example Entity

Entity details from Ui

C# Code Results

Entity

using System;
using Abp.Domain.Entities.Auditing;
using System.Collections.Generic;
using Abp.Domain.Entities;

namespace EFProject.Domain.Entities
{
	public class Teacher : FullAuditedEntity<int>
	{
		public Teacher()
		{
			Courses = new HashSet<Course>();
		}
		public string TeacherName { get; set; }
		public virtual ICollection<Course>Courses { get; set; }
		public int StandartId { get; set; }
		public virtual Standart Standart { get; set; }
	}
}

Entity Configuration (Entity Framework)

using EFProject.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace EFProject.Domain.Configurations
{
	public class TeacherConfiguration : IEntityTypeConfiguration<Teacher>
	{
		public void Configure(EntityTypeBuilder<Teacher> builder)
		{
			builder.ToTable("Teachers");
			builder.HasKey(x => x.Id);
			builder.Property(x => x.TeacherName).HasMaxLength(50);

			builder.HasMany(x => x.Courses)
				.WithOne(y => y.Teacher)
				.HasForeignKey(y => y.TeacherId)
				.OnDelete(DeleteBehavior.ClientSetNull);
		}
	}
}

Application Service

using Abp.Application.Services;
using Abp.Authorization;
using EFProject.Authorization;
using EFProject.Domain.Teacher.Dtos;
using EFProject.Domain.Teacher;
using EFProject.Domain.Entities;
using EFProject.EntityFrameworkCore.Repositories;
using System.Collections.Generic;
using System.Threading.Tasks;
using Abp.Application.Services.Dto;

namespace EFProject.Domain.Teacher
{
	[AbpAuthorize(PermissionNames.Teacher)]
	public class TeacherAppService : AsyncCrudAppService<Entities.Teacher, TeacherFullOutput, int, GetTeacherInput, CreateTeacherInput, UpdateTeacherInput, GetTeacherInput, DeleteTeacherInput>, ITeacherAppService
	{
		public TeacherAppService(ITeacherRepository teacherRepository) : base(teacherRepository)
		{
			CreatePermissionName = PermissionNames.Teacher_Create;
			UpdatePermissionName = PermissionNames.Teacher_Update;
			DeletePermissionName = PermissionNames.Teacher_Delete;
			GetPermissionName = PermissionNames.Teacher_Get;
			GetAllPermissionName = PermissionNames.Teacher_GetList;
		}

		[AbpAuthorize(PermissionNames.Teacher_GetList)]
		public async Task<PagedResultDto<TeacherFullOutput>> GetTeachersByStandartId(int standartId)
		{
			var items = await Repository.GetAllListAsync(x => x.StandartId == standartId);
			return new PagedResultDto<TeacherFullOutput>
			{
				TotalCount = items.Count,
				Items = ObjectMapper.Map<List<TeacherFullOutput>>(items)
			};
		}

	}
}

soft-craft-api's People

Contributors

bsogulcan avatar feramor avatar lamaney avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

feramor sindab

soft-craft-api's Issues

Create Entity page on Client-Side

  • Entity

Name
PrimaryKey type
AuditType(none or fullaudited)
TenantType(none,may,must)
Properties(list)

  • Property

Type(string for now)
Name
Nullable
RelationalEntity(if related another entity)

Enumerate Values on components

Add EnumList method ex:

enumArray:[
  {
     name : text,
     id : value
  },
]

Show 'name' values on list components.
Show dropdown list on create/edit components.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.